from datetime import datetime, timedelta
from config.database import AsyncSessionLocal
from module_stock.service.kline_boll_service import KlineBollService
from module_stock.service.kline_macd_service import KlineMacdService

class MacdUtil:

    """
    macd相关方法
    """
    @classmethod
    async def init_macd_df(cls):
        """
        应用启动时缓存macd

        :return:
        """
        async with AsyncSessionLocal() as session:
            await KlineMacdService.init_macd_cache(session)

class BollUtil:

    """
    boll相关方法
    """
    @classmethod
    async def init_boll_df(cls):
        """
        应用启动时缓存boll

        :return:
        """
        async with AsyncSessionLocal() as session:
            await KlineBollService.init_boll_cache(session)